<?php defined('ByShopWWI') or exit('Access Invalid!');?>
<div class="wrap">
  <div class="tabmenu">
    <?php include template('layout/submenu');?>
  </div>
  <div class="ncm-default-form">
    <form method="post" id="cash_form" action="<?php echo MEMBER_SITE_URL;?>/index.php?act=predeposit&op=pd_cash_add">
      <input type="hidden" name="form_submit" value="ok" />
      <dl>
      <?php  $shuifei = $output['list_setting']['site_shuifei']; ?>
         <script>
           function onc(){
			  
			var pdca=document.getElementById('pdc_amount').value;
			
			var tixian=document.getElementById('tixian').value;
		    shf.innerHTML=(pdca*<?php echo $shuifei;?>)/100;
			txje.innerHTML=pdca-(pdca*<?php echo $shuifei;?>)/100;
		
		   }
</script>
        <dt><i class="required">*</i>提现金额：</dt>
        <dd><input name="pdc_amount" type="text" class="text w50" onchange="onc()" id="pdc_amount" maxlength="40">
        <em class="add-on"><i class="icon-renminbi"></i></em><span></span> 
		<p class="hint">
		  当前可用金额：<strong class="orange"><?php echo floatval($output['member_info']['available_predeposit']);?></strong>&nbsp;&nbsp;元，
		  最大可提现金额：<strong style="color:#F00"><?php $tixian = floatval($output['member_info']['available_predeposit']);  $txje= floor($tixian/100)*100; echo $txje;?></strong>&nbsp;&nbsp;元，
		  提现税率：<?php  $shuifei = $output['list_setting']['site_shuifei']; echo $shuifei.'%'; ?>&nbsp;&nbsp; 
		  税费: <span id="shf"><?php $shf = $txje*$shuifei/100; echo $shf; ?></span> ,&nbsp;&nbsp; 
		  税后提现金额：<span id="txje"><?php echo $txje-$shf;?></span></p>
        </dd>
      </dl>
      <dl>
        <dt><i class="required">*</i>收款银行：</dt>
        <dd><input name="pdc_bank_name" type="text" class="text w200" id="pdc_bank_name" maxlength="40"/><span></span>
          <p class="hint">强烈建议优先填写国有4大银行(中国银行、中国建设银行、中国工商银行和中国农业银行)<br />
<strong style="color:#F00">请填写详细的开户银行分行名称，</strong>如中国农业银行商城支行。支付宝账号，填写“支付宝”即可。</p>
        </dd>
      </dl>
      <dl>
        <dt><i class="required">*</i>收款账号：</dt>
        <dd><input name="pdc_bank_no" type="text" class="text w200" id="pdc_bank_no" maxlength="30"/><span></span>
          <p class="hint">银行账号或虚拟账号(支付宝)</p>
        </dd>
      </dl>
      <dl>
        <dt><i class="required">*</i>开户人姓名：</dt>
        <dd><input name="pdc_bank_user" type="text" class="text w100" id="pdc_bank_user" maxlength="10" value="<?php echo ($output['member_info']['member_truename']);?>"/><span></span>
        <p class="hint">收款账号的开户人姓名</p>
          </dd>
      </dl>
      <dl>
        <dt><i class="required">*</i>支付密码：</dt>
        <dd><input name="password" type="password" class="text w100" id="password" maxlength="20" value=""/><span></span>
        <p class="hint">
              <?php if (!$output['member_info']['member_paypwd']) {?>
              <strong class="red">还未设置支付密码</strong><a href="index.php?act=member_security&op=auth&type=modify_paypwd" class="ncbtn-mini ncbtn-aqua vm ml10" target="_blank">马上设置</a>
              <?php } ?>
        </p>
          </dd>
      </dl>
      <dl class="bottom"><dt>&nbsp;</dt>
          <dd><label class="submit-border"><input type="submit" class="submit" value="确认提现" /></label><a class="ncbtn ml10" href="javascript:history.go(-1);">取消并返回</a></dd>
      </dl>
    </form>
  </div>
</div>
<script type="text/javascript">

$(function(){
	$('#cash_form').validate({
    	submitHandler:function(form){
			ajaxpost('cash_form', '', '', 'onerror')
	},
         errorPlacement: function(error, element){
            var error_td = element.parent('dd').children('span');
            error_td.append(error);
        },
        rules : {
	    pdc_amount      : {
	            required  : true,
	            digits    : true,
		    multiple  : true,
	            min       : 100.00,
	            max       : <?php $tixian = floatval($output['member_info']['available_predeposit']);  $txje= floor($tixian/100)*100; echo $txje;?>
            },
            pdc_bank_name :{
            	required  : true
            },
            pdc_bank_no : {
            	required  : true
            },
            pdc_bank_user : {
	        required  : true
	    },
	    password : {
	        required  : true
	    }
        },
        messages : {
            pdc_amount	  : {
            	required  :'<i class="icon-exclamation-sign"></i>请正确输入提现金额',
            	digits    :'<i class="icon-exclamation-sign"></i>提现金额必须是100的整数倍',
            	multiple  :'<i class="icon-exclamation-sign"></i>提现金额必须是100的整数倍',
            	min    	  :'<i class="icon-exclamation-sign"></i>提现金额最少是100',
            	max       :'<i class="icon-exclamation-sign"></i>提现金额超出账户余额'
            },
            pdc_bank_name :{
            	required   :'<i class="icon-exclamation-sign"></i>请输入收款银行'
            },
            pdc_bank_no : {
            	required   :'<i class="icon-exclamation-sign"></i>请输入收款账号'
            },
            pdc_bank_user : {
	        	required  : '<i class="icon-exclamation-sign"></i>请输入开户人姓名'
	    },
	    password : {
		        required : '<i class="icon-exclamation-sign"></i>请输入支付密码'
            }
        }
    });
	
	
	
	
});
</script>